/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.taobao.ibatiside.model.mapperv2.impl;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;

import org.eclipse.emf.ecore.impl.EFactoryImpl;

import org.eclipse.emf.ecore.plugin.EcorePlugin;

import org.taobao.ibatiside.model.mapperv2.*;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Factory</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class Mapperv2FactoryImpl extends EFactoryImpl implements Mapperv2Factory {
	/**
	 * Creates the default factory implementation.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static Mapperv2Factory init() {
		try {
			Mapperv2Factory theMapperv2Factory = (Mapperv2Factory)EPackage.Registry.INSTANCE.getEFactory("platform:/resource/org.taobao.ibatiside.model/model/map2x.xsd"); 
			if (theMapperv2Factory != null) {
				return theMapperv2Factory;
			}
		}
		catch (Exception exception) {
			EcorePlugin.INSTANCE.log(exception);
		}
		return new Mapperv2FactoryImpl();
	}

	/**
	 * Creates an instance of the factory.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Mapperv2FactoryImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public EObject create(EClass eClass) {
		switch (eClass.getClassifierID()) {
			case Mapperv2Package.CACHE_MODEL: return createCacheModel();
			case Mapperv2Package.DELETE: return createDelete();
			case Mapperv2Package.DISCRIMINATOR: return createDiscriminator();
			case Mapperv2Package.DOCUMENT_ROOT: return createDocumentRoot();
			case Mapperv2Package.DYNAMIC: return createDynamic();
			case Mapperv2Package.FLUSH_INTERVAL: return createFlushInterval();
			case Mapperv2Package.FLUSH_ON_EXECUTE: return createFlushOnExecute();
			case Mapperv2Package.GENERAL_STATEMENT: return createGeneralStatement();
			case Mapperv2Package.INCLUDE: return createInclude();
			case Mapperv2Package.INSERT: return createInsert();
			case Mapperv2Package.IS_EMPTY: return createIsEmpty();
			case Mapperv2Package.IS_EQUAL: return createIsEqual();
			case Mapperv2Package.IS_GREATER_EQUAL: return createIsGreaterEqual();
			case Mapperv2Package.IS_GREATER_THAN: return createIsGreaterThan();
			case Mapperv2Package.IS_LESS_EQUAL: return createIsLessEqual();
			case Mapperv2Package.IS_LESS_THAN: return createIsLessThan();
			case Mapperv2Package.IS_NOT_EMPTY: return createIsNotEmpty();
			case Mapperv2Package.IS_NOT_EQUAL: return createIsNotEqual();
			case Mapperv2Package.IS_NOT_NULL: return createIsNotNull();
			case Mapperv2Package.IS_NOT_PARAMETER_PRESENT: return createIsNotParameterPresent();
			case Mapperv2Package.IS_NOT_PROPERTY_AVAILABLE: return createIsNotPropertyAvailable();
			case Mapperv2Package.IS_NULL: return createIsNull();
			case Mapperv2Package.IS_PARAMETER_PRESENT: return createIsParameterPresent();
			case Mapperv2Package.IS_PROPERTY_AVAILABLE: return createIsPropertyAvailable();
			case Mapperv2Package.ITERATE: return createIterate();
			case Mapperv2Package.PARAMETER: return createParameter();
			case Mapperv2Package.PARAMETER_MAP: return createParameterMap();
			case Mapperv2Package.PROCEDURE: return createProcedure();
			case Mapperv2Package.PROPERTY: return createProperty();
			case Mapperv2Package.RESULT: return createResult();
			case Mapperv2Package.RESULT_MAP: return createResultMap();
			case Mapperv2Package.SELECT: return createSelect();
			case Mapperv2Package.SELECT_KEY: return createSelectKey();
			case Mapperv2Package.SQL: return createSql();
			case Mapperv2Package.SQL_MAP: return createSqlMap();
			case Mapperv2Package.STATEMENT: return createStatement();
			case Mapperv2Package.SUB_MAP: return createSubMap();
			case Mapperv2Package.TYPE_ALIAS: return createTypeAlias();
			case Mapperv2Package.UPDATE: return createUpdate();
			default:
				throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object createFromString(EDataType eDataType, String initialValue) {
		switch (eDataType.getClassifierID()) {
			case Mapperv2Package.ENUM_RESULT_TYPE:
				return createEnumResultTypeFromString(eDataType, initialValue);
			case Mapperv2Package.MODE_TYPE:
				return createModeTypeFromString(eDataType, initialValue);
			case Mapperv2Package.TYPE_TYPE:
				return createTypeTypeFromString(eDataType, initialValue);
			case Mapperv2Package.ENUM_RESULT_TYPE_OBJECT:
				return createEnumResultTypeObjectFromString(eDataType, initialValue);
			case Mapperv2Package.MODE_TYPE_OBJECT:
				return createModeTypeObjectFromString(eDataType, initialValue);
			case Mapperv2Package.TYPE_TYPE_OBJECT:
				return createTypeTypeObjectFromString(eDataType, initialValue);
			default:
				throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String convertToString(EDataType eDataType, Object instanceValue) {
		switch (eDataType.getClassifierID()) {
			case Mapperv2Package.ENUM_RESULT_TYPE:
				return convertEnumResultTypeToString(eDataType, instanceValue);
			case Mapperv2Package.MODE_TYPE:
				return convertModeTypeToString(eDataType, instanceValue);
			case Mapperv2Package.TYPE_TYPE:
				return convertTypeTypeToString(eDataType, instanceValue);
			case Mapperv2Package.ENUM_RESULT_TYPE_OBJECT:
				return convertEnumResultTypeObjectToString(eDataType, instanceValue);
			case Mapperv2Package.MODE_TYPE_OBJECT:
				return convertModeTypeObjectToString(eDataType, instanceValue);
			case Mapperv2Package.TYPE_TYPE_OBJECT:
				return convertTypeTypeObjectToString(eDataType, instanceValue);
			default:
				throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public CacheModel createCacheModel() {
		CacheModelImpl cacheModel = new CacheModelImpl();
		return cacheModel;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Delete createDelete() {
		DeleteImpl delete = new DeleteImpl();
		return delete;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Discriminator createDiscriminator() {
		DiscriminatorImpl discriminator = new DiscriminatorImpl();
		return discriminator;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DocumentRoot createDocumentRoot() {
		DocumentRootImpl documentRoot = new DocumentRootImpl();
		return documentRoot;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public org.taobao.ibatiside.model.mapperv2.Dynamic createDynamic() {
		DynamicImpl dynamic = new DynamicImpl();
		return dynamic;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public FlushInterval createFlushInterval() {
		FlushIntervalImpl flushInterval = new FlushIntervalImpl();
		return flushInterval;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public FlushOnExecute createFlushOnExecute() {
		FlushOnExecuteImpl flushOnExecute = new FlushOnExecuteImpl();
		return flushOnExecute;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public GeneralStatement createGeneralStatement() {
		GeneralStatementImpl generalStatement = new GeneralStatementImpl();
		return generalStatement;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Include createInclude() {
		IncludeImpl include = new IncludeImpl();
		return include;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Insert createInsert() {
		InsertImpl insert = new InsertImpl();
		return insert;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public IsEmpty createIsEmpty() {
		IsEmptyImpl isEmpty = new IsEmptyImpl();
		return isEmpty;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public IsEqual createIsEqual() {
		IsEqualImpl isEqual = new IsEqualImpl();
		return isEqual;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public IsGreaterEqual createIsGreaterEqual() {
		IsGreaterEqualImpl isGreaterEqual = new IsGreaterEqualImpl();
		return isGreaterEqual;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public IsGreaterThan createIsGreaterThan() {
		IsGreaterThanImpl isGreaterThan = new IsGreaterThanImpl();
		return isGreaterThan;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public IsLessEqual createIsLessEqual() {
		IsLessEqualImpl isLessEqual = new IsLessEqualImpl();
		return isLessEqual;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public IsLessThan createIsLessThan() {
		IsLessThanImpl isLessThan = new IsLessThanImpl();
		return isLessThan;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public IsNotEmpty createIsNotEmpty() {
		IsNotEmptyImpl isNotEmpty = new IsNotEmptyImpl();
		return isNotEmpty;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public IsNotEqual createIsNotEqual() {
		IsNotEqualImpl isNotEqual = new IsNotEqualImpl();
		return isNotEqual;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public IsNotNull createIsNotNull() {
		IsNotNullImpl isNotNull = new IsNotNullImpl();
		return isNotNull;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public IsNotParameterPresent createIsNotParameterPresent() {
		IsNotParameterPresentImpl isNotParameterPresent = new IsNotParameterPresentImpl();
		return isNotParameterPresent;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public IsNotPropertyAvailable createIsNotPropertyAvailable() {
		IsNotPropertyAvailableImpl isNotPropertyAvailable = new IsNotPropertyAvailableImpl();
		return isNotPropertyAvailable;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public IsNull createIsNull() {
		IsNullImpl isNull = new IsNullImpl();
		return isNull;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public IsParameterPresent createIsParameterPresent() {
		IsParameterPresentImpl isParameterPresent = new IsParameterPresentImpl();
		return isParameterPresent;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public IsPropertyAvailable createIsPropertyAvailable() {
		IsPropertyAvailableImpl isPropertyAvailable = new IsPropertyAvailableImpl();
		return isPropertyAvailable;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Iterate createIterate() {
		IterateImpl iterate = new IterateImpl();
		return iterate;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Parameter createParameter() {
		ParameterImpl parameter = new ParameterImpl();
		return parameter;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ParameterMap createParameterMap() {
		ParameterMapImpl parameterMap = new ParameterMapImpl();
		return parameterMap;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Procedure createProcedure() {
		ProcedureImpl procedure = new ProcedureImpl();
		return procedure;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Property createProperty() {
		PropertyImpl property = new PropertyImpl();
		return property;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Result createResult() {
		ResultImpl result = new ResultImpl();
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ResultMap createResultMap() {
		ResultMapImpl resultMap = new ResultMapImpl();
		return resultMap;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Select createSelect() {
		SelectImpl select = new SelectImpl();
		return select;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public SelectKey createSelectKey() {
		SelectKeyImpl selectKey = new SelectKeyImpl();
		return selectKey;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Sql createSql() {
		SqlImpl sql = new SqlImpl();
		return sql;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public SqlMap createSqlMap() {
		SqlMapImpl sqlMap = new SqlMapImpl();
		return sqlMap;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Statement createStatement() {
		StatementImpl statement = new StatementImpl();
		return statement;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public SubMap createSubMap() {
		SubMapImpl subMap = new SubMapImpl();
		return subMap;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public TypeAlias createTypeAlias() {
		TypeAliasImpl typeAlias = new TypeAliasImpl();
		return typeAlias;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Update createUpdate() {
		UpdateImpl update = new UpdateImpl();
		return update;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EnumResultType createEnumResultTypeFromString(EDataType eDataType, String initialValue) {
		EnumResultType result = EnumResultType.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertEnumResultTypeToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ModeType createModeTypeFromString(EDataType eDataType, String initialValue) {
		ModeType result = ModeType.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertModeTypeToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public TypeType createTypeTypeFromString(EDataType eDataType, String initialValue) {
		TypeType result = TypeType.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertTypeTypeToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EnumResultType createEnumResultTypeObjectFromString(EDataType eDataType, String initialValue) {
		return createEnumResultTypeFromString(Mapperv2Package.Literals.ENUM_RESULT_TYPE, initialValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertEnumResultTypeObjectToString(EDataType eDataType, Object instanceValue) {
		return convertEnumResultTypeToString(Mapperv2Package.Literals.ENUM_RESULT_TYPE, instanceValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ModeType createModeTypeObjectFromString(EDataType eDataType, String initialValue) {
		return createModeTypeFromString(Mapperv2Package.Literals.MODE_TYPE, initialValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertModeTypeObjectToString(EDataType eDataType, Object instanceValue) {
		return convertModeTypeToString(Mapperv2Package.Literals.MODE_TYPE, instanceValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public TypeType createTypeTypeObjectFromString(EDataType eDataType, String initialValue) {
		return createTypeTypeFromString(Mapperv2Package.Literals.TYPE_TYPE, initialValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertTypeTypeObjectToString(EDataType eDataType, Object instanceValue) {
		return convertTypeTypeToString(Mapperv2Package.Literals.TYPE_TYPE, instanceValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Mapperv2Package getMapperv2Package() {
		return (Mapperv2Package)getEPackage();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @deprecated
	 * @generated
	 */
	@Deprecated
	public static Mapperv2Package getPackage() {
		return Mapperv2Package.eINSTANCE;
	}

} //Mapperv2FactoryImpl
